﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Pampa.WebControls;

namespace Pampa.MVC.Fluent.CustomControls
{
    public class FloatingWindowBeginBuilder : IHtmlString
    {
        private readonly FloatingWindow _floatingWindow;

        public FloatingWindowBeginBuilder(FloatingWindow floatingWindow)
        {
            _floatingWindow = floatingWindow;
        }

        public FloatingWindowBeginBuilder ClientId(string clientId)
        {
            _floatingWindow.ID = clientId;
            return this;
        }

        public FloatingWindowBeginBuilder CssClass(string cssClass)
        {
            _floatingWindow.CssClass = cssClass;
            return this;
        }

        public FloatingWindowBeginBuilder Height(int height)
        {
            _floatingWindow.Height = height;
            return this;
        }

        public FloatingWindowBeginBuilder Width(int width)
        {
            _floatingWindow.Width = width;
            return this;
        }
        
        public FloatingWindowBeginBuilder CloseButton()
        {
            _floatingWindow.CloseButton = true;
            return this;
        }

        public string ToHtmlString()
        {
            var sb = new StringBuilder();
            sb.Append(_floatingWindow.RenderBeginTag());

            return sb.ToString();
        }
    }
}
